import pygame,random

class Wall():#创建障碍物
	def __init__(self,win,s,height = random.randint(100,400)):
		self.win = win
		self.s = s
		self.height = height
		self.rect = pygame.Rect(0,0,s.wall_width,height)
		self.rect.left = 600
		self.pass_ = False
		
	def update(self):
		self.rect.centerx -= self.s.square_speed
		pygame.draw.rect(self.win,self.s.wall_color,self.rect)